package com.esri.core.internal.tasks.ags.a;

import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.tasks.f;
import com.esri.core.map.LayerInfo;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;

/* loaded from: classes.dex */
public class b extends f {
    private static final long serialVersionUID = 1;
    private String a;
    private String[] c;
    private SpatialReference d;
    private Map<Integer, String> e;
    private int[] f;
    private LayerInfo[] j;
    private boolean k;
    private boolean l;
    private String m;
    private boolean b = true;
    private boolean g = true;
    private double h = Double.NaN;
    private int i = -1;

    @Override // com.esri.core.internal.tasks.f
    public boolean validate() {
        return false;
    }

    public String a() {
        return this.a;
    }

    public void a(String str) {
        this.a = str;
    }

    public boolean b() {
        return this.b;
    }

    public void a(boolean z) {
        this.b = z;
    }

    public String[] c() {
        return this.c;
    }

    public void a(String[] strArr) {
        this.c = strArr;
    }

    public SpatialReference d() {
        return this.d;
    }

    public void a(SpatialReference spatialReference) {
        this.d = spatialReference;
    }

    public Map<Integer, String> e() {
        return this.e;
    }

    public void a(Map<Integer, String> map) {
        this.e = map;
    }

    public int[] f() {
        return this.f;
    }

    public void a(int[] iArr) {
        this.f = iArr;
    }

    public boolean g() {
        return this.g;
    }

    public void b(boolean z) {
        this.g = z;
    }

    public double h() {
        return this.h;
    }

    public void a(double d) {
        this.h = d;
    }

    public int i() {
        return this.i;
    }

    public void a(int i) {
        this.i = i;
    }

    public LayerInfo[] j() {
        return this.j;
    }

    public void a(LayerInfo[] layerInfoArr) {
        this.j = layerInfoArr;
    }

    public boolean k() {
        return this.k;
    }

    public void c(boolean z) {
        this.k = z;
    }

    public boolean l() {
        return this.l;
    }

    public void d(boolean z) {
        this.l = z;
    }

    public String m() {
        return this.m;
    }

    public void b(String str) {
        this.m = str;
    }

    @Override // com.esri.core.internal.tasks.f
    public Map<String, String> generateRequestParams() throws Exception {
        LayerInfo[] layerInfoArr;
        int[] iArr;
        String[] strArr;
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        String str = this.a;
        if (str == null || str.length() == 0) {
            throw new RuntimeException("Search text is required for the Find task");
        }
        linkedHashMap.put("searchText", this.a);
        linkedHashMap.put("contains", this.b ? "true" : "false");
        String[] strArr2 = this.c;
        boolean z = true;
        if (strArr2 != null && strArr2.length > 0) {
            StringBuilder sb = new StringBuilder();
            boolean z2 = true;
            for (String str2 : this.c) {
                if (z2) {
                    z2 = false;
                } else {
                    sb.append(",");
                }
                sb.append(str2);
            }
            linkedHashMap.put("searchFields", sb.toString());
        }
        if (this.d != null) {
            linkedHashMap.put("sr", new Integer(this.d.getID()).toString());
        }
        Map<Integer, String> map = this.e;
        if (map != null && !map.isEmpty()) {
            StringBuilder sb2 = new StringBuilder();
            boolean z3 = true;
            for (Map.Entry<Integer, String> entry : this.e.entrySet()) {
                if (z3) {
                    z3 = false;
                } else {
                    sb2.append(";");
                }
                sb2.append(entry.getKey().toString() + ":" + entry.getValue());
            }
            linkedHashMap.put("layerDefs", sb2.toString());
        }
        int[] iArr2 = this.f;
        if (iArr2 != null && iArr2.length > 0) {
            StringBuilder sb3 = new StringBuilder();
            boolean z4 = true;
            for (int i : this.f) {
                if (z4) {
                    z4 = false;
                } else {
                    sb3.append(",");
                }
                sb3.append(i);
            }
            linkedHashMap.put("layers", sb3.toString());
        } else {
            linkedHashMap.put("layers", "");
        }
        linkedHashMap.put("returnGeometry", this.g ? "true" : "false");
        if (!Double.isNaN(this.h)) {
            linkedHashMap.put("maxAllowableOffset", new Double(this.h).toString());
        }
        if (this.i > -1) {
            linkedHashMap.put("geometryPrecision", new Integer(this.i).toString());
        }
        LayerInfo[] layerInfoArr2 = this.j;
        if (layerInfoArr2 != null && layerInfoArr2.length > 0) {
            StringBuilder sb4 = new StringBuilder("[");
            for (LayerInfo layerInfo : this.j) {
                if (z) {
                    z = false;
                } else {
                    sb4.append(",");
                }
                sb4.append(layerInfo.toJson());
            }
            sb4.append(']');
            linkedHashMap.put("dynamicLayers", sb4.toString());
        }
        linkedHashMap.put("returnZ", this.k ? "true" : "false");
        linkedHashMap.put("returnM", this.l ? "true" : "false");
        linkedHashMap.put("gdbVersion", this.m);
        return linkedHashMap;
    }

    public int hashCode() {
        int hashCode = ((super.hashCode() * 31) + (this.b ? 1231 : 1237)) * 31;
        String str = this.m;
        int hashCode2 = str == null ? 0 : str.hashCode();
        long doubleToLongBits = Double.doubleToLongBits(this.h);
        int hashCode3 = (((((((((hashCode + hashCode2) * 31) + this.i) * 31) + this.e.hashCode()) * 31) + Arrays.hashCode(this.f)) * 31) + ((int) (doubleToLongBits ^ (doubleToLongBits >>> 32)))) * 31;
        SpatialReference spatialReference = this.d;
        int id = (((((((((hashCode3 + (spatialReference == null ? 0 : spatialReference.getID())) * 31) + (this.g ? 1231 : 1237)) * 31) + (this.l ? 1231 : 1237)) * 31) + (this.k ? 1231 : 1237)) * 31) + Arrays.hashCode(this.c)) * 31;
        String str2 = this.a;
        return id + (str2 != null ? str2.hashCode() : 0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (super.equals(obj) && getClass() == obj.getClass()) {
            b bVar = (b) obj;
            if (this.b != bVar.b) {
                return false;
            }
            String str = this.m;
            if (str == null) {
                if (bVar.m != null) {
                    return false;
                }
            } else if (!str.equals(bVar.m)) {
                return false;
            }
            if (this.i == bVar.i && this.e.equals(bVar.e) && Arrays.equals(this.f, bVar.f) && Double.doubleToLongBits(this.h) == Double.doubleToLongBits(bVar.h)) {
                SpatialReference spatialReference = this.d;
                if (spatialReference == null) {
                    if (bVar.d != null) {
                        return false;
                    }
                } else if (!spatialReference.equals(bVar.d)) {
                    return false;
                }
                if (this.g == bVar.g && this.l == bVar.l && this.k == bVar.k && Arrays.equals(this.c, bVar.c)) {
                    String str2 = this.a;
                    if (str2 == null) {
                        if (bVar.a != null) {
                            return false;
                        }
                    } else if (!str2.equals(bVar.a)) {
                        return false;
                    }
                    return true;
                }
                return false;
            }
            return false;
        }
        return false;
    }
}
